Skip to content

Conversation

@mhaessig
Copy link
Contributor

@mhaessig mhaessig commented Nov 3, 2025

Problem Analysis

The stress test compiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java, which uses the StressUnstableIfTrap flag, failed intermittently with the assert "no node with a side effect" during C2 compilation. I tracked down the origin of the failure to the raw store of the unstable if trap stress counter that was missing a memory edge to the backedge phi and thus had no side effect in the loop, which lead to the aforementioned assert. During parsing, the missing memory edge gets discarded with as vestigial parsing state when do_if() ends up stopped(). However, the effect of the stress counter should still be wired back into the backedge since it will be incremented in the next iteration.

Patch Description

To prevent the stress counters memory state being lost to PreserveJVMState, I pass it to the caller over an out-parameter and set_memory with that node, similar to what is already done for control. This is only necessary for the two last invocation of do_if() in do_acmp() where they are actually allowed to trap. Further, this PR reenables StressUnstableIfTrap in compiler/valhalla/inlinetypes/TestAcmpWithUnstableIf.java.

Testing

  • tier1,tier2,tier3 plus internal stress testing

Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8367244: [lworld] C2 compilation fails with assert "no node with a side effect" (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1716/head:pull/1716
$ git checkout pull/1716

Update a local copy of the PR:
$ git checkout pull/1716
$ git pull https://git.openjdk.org/valhalla.git pull/1716/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1716

View PR using the GUI difftool:
$ git pr show -t 1716

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1716.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 3, 2025

👋 Welcome back mhaessig! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 3, 2025

@mhaessig This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8367244: [lworld] C2 compilation fails with assert "no node with a side effect"

Reviewed-by: chagedorn

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 6 new commits pushed to the lworld branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@chhagedorn) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@mhaessig mhaessig marked this pull request as ready for review November 3, 2025 14:30
@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 3, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 3, 2025

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, thanks for fixing this!

* compiler.valhalla.inlinetypes.TestAcmpStressUnstableIf
* @run main/othervm -Xbatch -XX:-TieredCompilation
* -XX:CompileCommand=compileonly,compiler/valhalla/inlinetypes/TestAcmpStressUnstableIf.test
* -XX:+UnlockDiagnosticVMOptions -XX:+StressUnstableIfTraps -XX:RepeatCompilation=100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the test will be run over and over again, I think we can remove RepeatCompilation to improve test execution time.

@mhaessig
Copy link
Contributor Author

mhaessig commented Nov 6, 2025

Thank you for having a look, @chhagedorn. I removed the repeated compilation.

@mhaessig
Copy link
Contributor Author

mhaessig commented Nov 6, 2025

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 6, 2025
@openjdk
Copy link

openjdk bot commented Nov 6, 2025

@mhaessig
Your change (at version 9e09aa2) is now ready to be sponsored by a Committer.

@chhagedorn
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 7, 2025

Going to push as commit a0ec244.
Since your change was applied there have been 104 commits pushed to the lworld branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 7, 2025
@openjdk openjdk bot closed this Nov 7, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 7, 2025
@openjdk
Copy link

openjdk bot commented Nov 7, 2025

@chhagedorn @mhaessig Pushed as commit a0ec244.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants